package com.cyzy.server.dao;

import com.cyzy.pojo.entity.HuntCard;
import com.cyzy.pojo.entity.HuntTag;
import com.cyzy.pojo.entity.RecruitTag;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HuntCardTagsDao {

    /**
     * 批量插入标签
     * @param tags
     */
    void insertBatch(List<HuntTag> tags);

    /**
     *根据id删除求职帖子里的标签
     */
    @Delete("delete from hunt_tag where hunt_card_id = #{id}")
    void deleteByHuntCardId(Integer id);

    /**
     * 根据求职帖子的id查询标签
     */
    @Select("select * from hunt_tag where hunt_card_id = #{id}")
    List<HuntTag> selectHuntTagByHuntId(Integer id);

    /**
     * 根据id更新求职贴的标签
     */
    @Update("UPDATE hunt_tag SET value = #{value} WHERE hunt_card_id = #{huntCardId}")
    void updateHuntTag(HuntTag huntTag);

}
